;Exercise 1.15
;The sine of an angle (specified in radians) can be computed by making use of 
;the approximation sin x approx x if x is sufficiently small, and the 
;trigonometric identity
;               x             x
;sin x = 3 sin --- - 4 sin^3 ---
;               3             3
;to reduce the size of the argument of sin. (For purposes of this exercise an
;angle is considered “sufficiently small” if its magnitude is not greater than 
;0.1 radians.) These ideas are incorporated in the following procedures:
(define (cube x) (* x x x))
(define (p x) (- (* 3 x) (* 4 (cube x))))
(define (sine angle)
   (if (not (> (abs angle) 0.1))
       angle
       (p (sine (/ angle 3.0)))))

(define (count x) (count_sine x 0))
(define (count_sine angle i)
   (if (not (> (abs angle) 0.1))
       i
       (count_sine (/ angle 3.0) (+ i 1))))
;a. How many times is the procedure p applied when (sine 12.15) is evaluated?
;b. What is the order of growth in space and number of steps (as a function
;   of a) used by the process generated by the sine procedure when (sine a)
;   is evaluated?

;a. 5 vezes
;b. Se o angulo em radianos triplicar é necessária apenas mais um passo,
;portanto a ordem de crescimento do número de passos é teta(log a). Já o
;crescimento do espaço é teta(4^log a), pois cada passo multiplica por 4 o
;espaço.
